<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-bind</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
<!-- v-bind:把data中的数据绑定到标签上，作为标签的属性-->
        <img src="img/1.jpg" />
        <img v-bind:src="imgsrc" @click="changeImg" />
        简写
        <img :src="imgsrc" />
    </div>
</body>
    <script type="text/javascript">

        new Vue({
            el:"#app",
            data:{
                imgsrc:'img/2.jpg'
            },
            methods:{
                changeImg(){
                    this.imgsrc='img/1.jpg'
                }
            }
        })
    </script>
</html>